import 'package:flutter/material.dart';

class YearToggleButtons extends StatelessWidget {
  final int selectedYear;
  final Function(int) onYearSelected;

  const YearToggleButtons({
    super.key,
    required this.selectedYear,
    required this.onYearSelected,
  });

  @override
  Widget build(BuildContext context) {
    return Container(
      decoration: BoxDecoration(
        color: Colors.grey.shade200,
        borderRadius: BorderRadius.circular(20),
      ),
      child: ToggleButtons(
        isSelected: [selectedYear == 2023, selectedYear == 2024, selectedYear == 2025],
        onPressed: (index) {
          onYearSelected(2023 + index);
        },
        borderRadius: BorderRadius.circular(20),
        selectedColor: Colors.white,
        color: Colors.black,
        fillColor: const Color(0xFF4DD0E1),
        renderBorder: false,
        constraints: const BoxConstraints(minHeight: 30.0, minWidth: 60.0),
        children: const [
          Padding(padding: EdgeInsets.symmetric(horizontal: 12), child: Text('2023')),
          Padding(padding: EdgeInsets.symmetric(horizontal: 12), child: Text('2024')),
          Padding(padding: EdgeInsets.symmetric(horizontal: 12), child: Text('2025')),
        ],
      ),
    );
  }
}